@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <section class="panel panel-default text-sm doc-buttons">
            <div class="panel-body">
                <a href="{{ route('admin.message.field_add') }}" class="btn btn-info"><i
                            class="icon-plus ico"></i>
                    &nbsp; 添加设置</a>
            </div>
        </section>
    </div>

    <div class="col-md-12">
        <section class="panel panel-default">
            <header class="panel-heading">
                {{ $frame['title'] }}
            </header>
            <table class="table table-striped m-b-none">
                <thead>
                <tr>
                    <th>绑定字段</th>
                    <th>名称</th>
                    <th>编辑时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @if(!empty($fields))
                    @foreach( $fields as $field )
                        <tr>
                            <td>
                                <a class="m-r" href="{{ route('admin.message.field') }}?status={{ $field->id }}">
                                    @if( (bool)$field->status )
                                        <i class="fa-tags fa text-xs text-ff552e text-center-xs" title="设置开启"></i>
                                    @else
                                        <i class="fa-tags fa text-xs text-no text-center-xs" title="设置关闭"></i>
                                    @endif
                                </a>
                                <span class="text-danger">{{ $field->field }}</span>
                                绑定到
                                <span class="text-info">{{ $field->alias }}</span>
                                @if(!empty($field->value))
                                    <small class="text-small">( 字段值:{{ $field->value }} )</small>
                                @endif
                            </td>
                            <td>{{ $field->name }}</td>
                            <td>{{ $field->updated_at }}</td>
                            <td>
                                <a href="{{ route('admin.message.field_edit',$field->id) }}"
                                   class="btn btn-xs btn-default">编辑</a>
                                <a href="{{ route('admin.message.field') }}?del={{ $field->id }}"
                                   class="btn btn-xs btn-danger">删除</a>
                            </td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td align="center" colspan="4">
                            暂未设置在线留言字段,请 <a href="{{ route('admin.message.field') }}"
                                            class="text-info">添加</a> !
                        </td>
                    </tr>
                @endif
                </tbody>
            </table>
        </section>
    </div>
@endsection

@section('css')
@endsection

@section('js')
@endsection